        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>RevoluteJointDef class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="RevoluteJointDef">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/RevoluteJointDef.html">RevoluteJointDef</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>RevoluteJointDef</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class RevoluteJointDef extends JointDef {
 /**
  *  The local anchor point relative to body1's origin.
  */
 vec2 localAnchorA;

 /**
  *  The local anchor point relative to body2's origin.
  */
 vec2 localAnchorB;

 /**
  *  The body2 angle minus body1 angle in the reference state (radians).
  */
 num referenceAngle;

 /**
  *  A flag to enable joint limits.
  */
 bool enableLimit;

 /**
  *  The lower angle for the joint limit (radians).
  */
 num lowerAngle;

 /**
  *  The upper angle for the joint limit (radians).
  */
 num upperAngle;

 /**
  *  A flag to enable the joint motor.
  */
 bool enableMotor;

 /**
  *  The desired motor speed. Usually in radians per second.
  */
 num motorSpeed;

 /**
  *  The maximum motor torque used to achieve the desired motor speed.
  *  Usually in N-m.
  */
 num maxMotorTorque;

 RevoluteJointDef() :
   super(),
   localAnchorA = new vec2.zero(),
   localAnchorB = new vec2.zero(),
   referenceAngle = 0.0,
   lowerAngle = 0.0,
   upperAngle = 0.0,
   maxMotorTorque = 0.0,
   motorSpeed = 0.0,
   enableLimit = false,
   enableMotor = false {
   type = JointType.REVOLUTE;
 }

 /**
  * Initialize the bodies, anchors, and reference angle using the world
  * anchor.
  */
 void initialize(Body b1, Body b2, vec2 anchor) {
   bodyA = b1;
   bodyB = b2;
   bodyA.getLocalPointToOut(anchor, localAnchorA);
   bodyB.getLocalPointToOut(anchor, localAnchorB);
   referenceAngle = bodyA.angle - bodyB.angle;
 }
}
</pre>
</div>
<h3>Extends</h3>
<p>
<span class="type-box"><span class="icon-class"></span><a href="../box2d/JointDef.html">JointDef</a></span>&nbsp;&gt;&nbsp;<span class="type-box"><span class="icon-class"></span><strong>RevoluteJointDef</strong></span></p>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="RevoluteJointDef">
<button class="show-code">Code</button>
new <strong>RevoluteJointDef</strong>() <a class="anchor-link" href="#RevoluteJointDef"
              title="Permalink to RevoluteJointDef.RevoluteJointDef">#</a></h4>
<div class="doc">
<pre class="source">
RevoluteJointDef() :
 super(),
 localAnchorA = new vec2.zero(),
 localAnchorB = new vec2.zero(),
 referenceAngle = 0.0,
 lowerAngle = 0.0,
 upperAngle = 0.0,
 maxMotorTorque = 0.0,
 motorSpeed = 0.0,
 enableLimit = false,
 enableMotor = false {
 type = JointType.REVOLUTE;
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field inherited"><h4 id="bodyA">
<button class="show-code">Code</button>
<a href="../box2d/Body.html">Body</a>         <strong>bodyA</strong> <a class="anchor-link"
            href="#bodyA"
            title="Permalink to RevoluteJointDef.bodyA">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
bodyA
</pre>
</div>
</div>
<div class="field inherited"><h4 id="bodyB">
<button class="show-code">Code</button>
<a href="../box2d/Body.html">Body</a>         <strong>bodyB</strong> <a class="anchor-link"
            href="#bodyB"
            title="Permalink to RevoluteJointDef.bodyB">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
bodyB
</pre>
</div>
</div>
<div class="field inherited"><h4 id="collideConnected">
<button class="show-code">Code</button>
bool         <strong>collideConnected</strong> <a class="anchor-link"
            href="#collideConnected"
            title="Permalink to RevoluteJointDef.collideConnected">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
collideConnected
</pre>
</div>
</div>
<div class="field"><h4 id="enableLimit">
<button class="show-code">Code</button>
bool         <strong>enableLimit</strong> <a class="anchor-link"
            href="#enableLimit"
            title="Permalink to RevoluteJointDef.enableLimit">#</a>
        </h4>
        <div class="doc">
<pre class="source">
enableLimit
</pre>
</div>
</div>
<div class="field"><h4 id="enableMotor">
<button class="show-code">Code</button>
bool         <strong>enableMotor</strong> <a class="anchor-link"
            href="#enableMotor"
            title="Permalink to RevoluteJointDef.enableMotor">#</a>
        </h4>
        <div class="doc">
<pre class="source">
enableMotor
</pre>
</div>
</div>
<div class="field"><h4 id="localAnchorA">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a>         <strong>localAnchorA</strong> <a class="anchor-link"
            href="#localAnchorA"
            title="Permalink to RevoluteJointDef.localAnchorA">#</a>
        </h4>
        <div class="doc">
<pre class="source">
localAnchorA
</pre>
</div>
</div>
<div class="field"><h4 id="localAnchorB">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a>         <strong>localAnchorB</strong> <a class="anchor-link"
            href="#localAnchorB"
            title="Permalink to RevoluteJointDef.localAnchorB">#</a>
        </h4>
        <div class="doc">
<pre class="source">
localAnchorB
</pre>
</div>
</div>
<div class="field"><h4 id="lowerAngle">
<button class="show-code">Code</button>
num         <strong>lowerAngle</strong> <a class="anchor-link"
            href="#lowerAngle"
            title="Permalink to RevoluteJointDef.lowerAngle">#</a>
        </h4>
        <div class="doc">
<pre class="source">
lowerAngle
</pre>
</div>
</div>
<div class="field"><h4 id="maxMotorTorque">
<button class="show-code">Code</button>
num         <strong>maxMotorTorque</strong> <a class="anchor-link"
            href="#maxMotorTorque"
            title="Permalink to RevoluteJointDef.maxMotorTorque">#</a>
        </h4>
        <div class="doc">
<pre class="source">
maxMotorTorque
</pre>
</div>
</div>
<div class="field"><h4 id="motorSpeed">
<button class="show-code">Code</button>
num         <strong>motorSpeed</strong> <a class="anchor-link"
            href="#motorSpeed"
            title="Permalink to RevoluteJointDef.motorSpeed">#</a>
        </h4>
        <div class="doc">
<pre class="source">
motorSpeed
</pre>
</div>
</div>
<div class="field"><h4 id="referenceAngle">
<button class="show-code">Code</button>
num         <strong>referenceAngle</strong> <a class="anchor-link"
            href="#referenceAngle"
            title="Permalink to RevoluteJointDef.referenceAngle">#</a>
        </h4>
        <div class="doc">
<pre class="source">
referenceAngle
</pre>
</div>
</div>
<div class="field inherited"><h4 id="type">
<button class="show-code">Code</button>
int         <strong>type</strong> <a class="anchor-link"
            href="#type"
            title="Permalink to RevoluteJointDef.type">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
type
</pre>
</div>
</div>
<div class="field"><h4 id="upperAngle">
<button class="show-code">Code</button>
num         <strong>upperAngle</strong> <a class="anchor-link"
            href="#upperAngle"
            title="Permalink to RevoluteJointDef.upperAngle">#</a>
        </h4>
        <div class="doc">
<pre class="source">
upperAngle
</pre>
</div>
</div>
<div class="field inherited"><h4 id="userData">
<button class="show-code">Code</button>
Object         <strong>userData</strong> <a class="anchor-link"
            href="#userData"
            title="Permalink to RevoluteJointDef.userData">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
userData
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="initialize">
<button class="show-code">Code</button>
void <strong>initialize</strong>(<a href="../box2d/Body.html">Body</a> b1, <a href="../box2d/Body.html">Body</a> b2, <a href="../vector_math/vec2.html">vec2</a> anchor) <a class="anchor-link" href="#initialize"
              title="Permalink to RevoluteJointDef.initialize">#</a></h4>
<div class="doc">
<p>Initialize the bodies, anchors, and reference angle using the world
anchor.</p>
<pre class="source">
void initialize(Body b1, Body b2, vec2 anchor) {
 bodyA = b1;
 bodyB = b2;
 bodyA.getLocalPointToOut(anchor, localAnchorA);
 bodyB.getLocalPointToOut(anchor, localAnchorB);
 referenceAngle = bodyA.angle - bodyB.angle;
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
